package com.restaurant.application.coupon.support;

import com.nebutown.base.ViewSpec;
import com.nebutown.base.data.ViewUpdate;
import com.nebutown.description.data.UnitForGeneration;
import com.nebutown.generation.PickableBean;
import com.nebutown.supporthome.AbstractBase;
import com.nebutown.supporthome.CmdCapsule;
import com.restaurant.application.coupon.CouponImpl;
import com.restaurant.application.indexes.couponlist.mysql.CouponListBean;

public class CouponBase extends AbstractBase {
    private UnitForGeneration desc = new UnitForGeneration();

    public AbstractCoupon getImpl() {
        AbstractCoupon inst = new CouponImpl();
        inst.setBase(this, getEscort());
        return inst;
    }

    @Override
    public CouponOutFace getUnitFace() {
        return new CouponOutFace(this);
    }

    @Override
    protected Object callDistr(String name, Object... param) {
        switch(name) {
            case "update": return getImpl().update((CouponData)param[0]);
            case "init":
                return getImpl().init((CouponData) param[0]);
            case "getCardBean": return getImpl().getCardBean();
            case "confirmUse":
                return getImpl().confirmUse((String) param[0]);
            case "findData":
                return getImpl().findData();
            case "confirmReceive":
                return getImpl().confirmReceive((int) param[0]);
            case "getId": return getImpl().getId();
            case "getEffectiveInterface":
                return getImpl().getEffectiveInterface();
            case "getFullView": setIsRefresher(); return getImpl().getFullView();
            case "getViewLead":
                return getImpl().getViewLead((ViewSpec) param[0]);
            case "getCouponUidDataForCouponList": return getImpl().getCouponUidDataForCouponList((CouponListBean)param[0]);
        }
        return null;
    }

    @Override
    protected boolean authDistr(String name) {
        switch(name) {
        }
        return true;
    }

    @Override
    public CmdCapsule getUICall(int cmd) {
        switch(cmd) {
        }
        return null;
    }

    @Override
    public ViewUpdate uiCall(int cmd, PickableBean param, int... seq) {
        switch(cmd) {
        }
        return null;
    }
}
